# Maintainer: Florian Pritz <bluewind@xinu.at>

pkgname=perl-dir-self
pkgver=0.11
pkgrel=9
pkgdesc='a __DIR__ constant for the directory your source file is in'
arch=(any)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=(perl)
url=https://metacpan.org/release/Dir-Self
source=("https://search.cpan.org/CPAN/authors/id/M/MA/MAUKE/Dir-Self-$pkgver.tar.gz")
md5sums=(e484446c3aa042737c0b7cbd0fb2f904)
sha512sums=(c2795149e74c71037fab8c3149e85e11d4ee77dbb54f85d07e49c39504b3ba910a5ded32831adf36915b302abc4ced386dcd51b6dfbaef46e069c803793e8efc)
_ddir="Dir-Self-$pkgver"

build()
(
  cd "$srcdir/$_ddir"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  unset PERL5LIB PERL_MM_OPT
  /usr/bin/perl Makefile.PL
  make
)

check()
(
  cd "$srcdir/$_ddir"
  export PERL_MM_USE_DEFAULT=1
  unset PERL5LIB
  make test
)

package()
(
  cd "$srcdir/$_ddir"
  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
)

# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et:
